﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
using Volo.Abp;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace Vouchers
{
    [Comment("消耗单")]
    [Table("t_consumevoucher")]
    [Index(nameof(VoucherCode))]
    public class ConsumeVoucher : VoucherBase
    {
        public ConsumeVoucher(Guid keyId)

        {
            this.Id = keyId;
        }

        public ConsumeVoucher()
        {

        }
        [Comment("消耗科室Id")]
        public Guid? DeptId { get; set; }
        [Comment("消耗科室名称")]
        public string DeptName { get; set; }

        [Comment("手术信息主键ID")]
        public Guid? OperatId { get; set; }

        [Comment("计费护士")]
        [MaxLength(200)]
        public string BillingNurse { get; set; }


        [Comment("产品管理方式 0数量管理，1定数管理")]
        public int ProductMethod { get; set; }

        [Comment("单据类型（0-普通消耗 1-计费消耗  2-手术套包消耗 3-手术跟台消耗（简易版) 4-手术跟台消耗（常规版）")]
        public int VoucherType { get; set; }

        [Comment("来源系统（0-SPD  1-HIS  3-其他")]
        public int SourceType { get; set; }

        [Comment("是否计费 空：未计费 0：计费失败 1：已计费")]
        public int IsCharging { get; set; }

        [Comment("计费科室")]
        public Guid? ChargeDeptId { get; set; }

        [MaxLength(50)]
        [Comment("计费科室")]
        public string ChargeDeptName { get; set; }

        [MaxLength(50)]
        [Comment("住院号")]
        public string HospitalCode { get; set; }

        [Display(Name = "病案号")]
        [MaxLength(50, ErrorMessage = "{0}最大允许50字节")]
        public string MedicalCode { get; set; }

        [MaxLength(50)]
        [Comment("患者姓名")]
        public string PatientName { get; set; }

        [MaxLength(20)]
        [Comment("床位号")]
        public string DedsCode { get; set; }

        [MaxLength(5)]
        [Comment("性别")]
        public string PatientSex { get; set; }

        [Comment("年龄")]
        public int? PatientAge { get; set; }

        [Comment("患者身份证号")]
        [MaxLength(50)]
        public string PatientIdNumber { get; set; }

        [Comment("管床医生证件号")]
        [MaxLength(50)]
        public string ManageBedDoctorId { get; set; }

        [Comment("手术单号")]
        [MaxLength(50)]
        public string OperationCode { get; set; }

        [Comment("手术名称")]
        [MaxLength(50)]
        public string OperationName { get; set; }

        [Comment("手术医生")]
        [MaxLength(50)]
        public string OperationDoctor { get; set; }

        [Comment("开单医生")]
        [MaxLength(50)]
        public string ChiefDoctor { get; set; }

        [Comment("手术日期")]
        public DateTime? OperationTime { get; set; }

        [Comment("住院次数")]
        public int? InHospitalNumber { get; set; }

        [Comment("计费时间")]
        public DateTime? ChargeTime { get; set; }

        [Comment("单据类型 (0-消耗单、1-消退单、2-损耗消耗单、3-损耗消退单)")]
        public int VoucherClass { get; set; }

        [Comment("所属科室Id")]
        public Guid? BelongDeptId { get; set; }

        [MaxLength(200)]
        [Comment("所属科室名称")]
        public string BelongDeptName { get; set; }

        [Comment("医生所属科室Id")]
        public Guid? DoctorDeptId { get; set; }

        [MaxLength(200)]
        [Comment("医生所属科室名称")]
        public string DoctorDeptName { get; set; }

        [Comment("是否植入介入消耗单")]
        public bool IsImplant { get; set; }

        [MaxLength(50)]
        [Comment("HIS开单科室编码")]
        public string HisChargeDeptCode { get; set; }

        [MaxLength(50)]
        [Comment("HIS开单科室名称")]
        public string HisChargeDeptName { get; set; }

        [MaxLength(50)]
        [Comment("HIS执行科室编码")]
        public string HisExecDeptCode { get; set; }

        [MaxLength(50)]
        [Comment("HIS执行科室编码")]
        public string HisExecDeptName { get; set; }

        [Comment("单据来源")]
        [MaxLength(50)]
        public string OrderSource { get; set; }

    }
}
